package cn.bone.web.test.controller;

import cn.bone.web.test.component.SnowflakeFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;


/*
百度开源的分布式唯一id生成器    UidGenerator
美团点评分布式id生成系统       Leaf
 */
@RestController
public class IdController {

    @Resource
    private SnowflakeFactory snowflakeFactory;

    @RequestMapping("/id/get")
    public String get(){

        return snowflakeFactory.getStrId();
    }
}
